package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.example.myapplication.utils.DateUtil;

public class sendActivity extends AppCompatActivity implements View.OnClickListener {

    private TextView message;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_send);

        View view = findViewById(R.id.send);
        view.setOnClickListener(this);

        message = findViewById(R.id.message);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.send:
                Intent intent = new Intent(this,receiveActivity.class);
                Bundle bundle = new Bundle();
                bundle.putString("request_time", DateUtil.getNowtime());
                bundle.putString("request_content",message.getText().toString());
                intent.putExtras(bundle);
                startActivity(intent);
        }


    }
}